package com.demo.mantis.service;

import java.util.Random;

import javax.inject.Singleton;

import com.demo.mantis.data.FriendDao;
import com.demo.mantis.model.Book;
import com.demo.mantis.model.Friend;

import cn.techarts.dragonfly.app.AbstractService;
import cn.techarts.dragonfly.data.trans.Transactional;

@Singleton
public class CalculatorServiceImpl implements CalculatorService {
	
	public float plus(float x,float y) {
		return x + y;
	}
	
	@Override
	public float subtract(float x,float y) {
		return x - y;
	}
	
	@Override
	public float multiply(float x,float y) {
		return x * y;
	}
	
	@Override
	public float divide(float x,float y) {
		if(y == 0f) {
			 throw new IllegalArgumentException("除数不能为零");
			
		}
		return x / y;
	}
	

}
